# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Thomas Kienlen <kommander@laposte.net>
pkgname=plib
pkgver=1.8.5
pkgrel=3
pkgdesc="Portable Game Library"
url="https://plib.sourceforge.net/"
arch="all"
license="LGPL-2.0-or-later"
makedepends="$depends_dev libxi-dev libxmu-dev mesa-dev"
source="https://plib.sourceforge.net/dist/plib-$pkgver.tar.gz
	includes-fix.patch
	CVE-2011-4620.patch
	CVE-2012-4552.patch
	"

# secfixes:
#   1.8.5-r1:
#     - CVE-2012-4552
#     - CVE-2011-4620

prepare() {
	default_prepare
	update_config_guess
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
17154cc77243fe576c2bcbcb0285b98aef1a0634658f5473e95fe0ac8fa3ed477dbe5620e44ccf0b7cc616f812af0cd44d6fcbba0c563180d3b61c9d6f158e1d  plib-1.8.5.tar.gz
a7a3f0514c698945b47cbf5242b3213df9ac9265b52268b6dfea50e51597dadf0f4e83608bc6b25d6deb22b42505162e25192de082590effbdda8f38d0860dc8  includes-fix.patch
5d2312dcc03ffe28c3abe17f3a9aac2dcaf7986b22caa3e07f21e4499ab4fc99e3900164a5a350315b06d2378bcd0ee7fda3cf361faa36f05bcc52078db0e9ac  CVE-2011-4620.patch
fe8fa3b7dae8bce3fbc85ceb8dd9cd1b65b8baa35714884890cac1012d3a0fdb55c04b52d2af67666436be75f9a512aa5ab9d9455db19dfe06d75dee5f581719  CVE-2012-4552.patch
"
